package com.example.nio.stream;

import static java.util.stream.Collectors.toList;

import java.util.ArrayList;
import java.util.Comparator;
import java.util.List;
import java.util.stream.Collectors;
import java.util.stream.Stream;

public class LazyExample {


    public static void main(String[] args) {
        List<String> list = new ArrayList<>();
        list.add("1");
        list.add("2");
        list.add("3");
        System.out.println("kaishi");
        Stream a = list.stream().filter((s) -> {
            System.out.println(s);
            return !s.equals("2");
        }).map((s -> {
            System.out.println(Integer.valueOf(s));
            return Integer.valueOf(s);
        }));
        System.out.println("----------------");
        List<Integer> integers = (List<Integer>) a.collect(toList());
        System.out.println(integers);

        Stream l = list.stream();

    }
}
